﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tomahawk.Runtime;
using ActorsAndComponents.Logic;
using Tomahawk.Runtime.Logic;
using Microsoft.Xna.Framework;

namespace Initialization.GameStates
{
    class BasicGameState : GameState
    {
        protected override void OnLoad()
        {
            Engine.Instance.ResourceManager.LoadPendantResources(this.ContentManager);
        }

        protected override void OnUnload()
        {
        }

        protected override void OnInitialize()
        {

            // Locate the camera in a convenient way

            Tomahawk.Runtime.Rendering.Camera camera = Engine.Instance.CameraManager.ActiveCamera;
            camera.LookAt(
                new Vector3(-50, 0, 0),
                new Vector3(0, 0, 0),
                Vector3.UnitY);

            // Create an instance of an actor with an archetype that will add a XStaticMeshComponent to it

            InlinedInArchetype inlinedInArchetype = (InlinedInArchetype)XWorld.Instance.CreateObject(
                typeof(InlinedInArchetype), "", @"Examples.ActorsAndComponents.Content\InlinedComponent.xml");
        
            // Create an instance of an actor that will add a XStaticMeshComponent dynamically in code

            DynamicallyAdded dynamicallyAdded = (DynamicallyAdded)XWorld.Instance.CreateObject(
                typeof(DynamicallyAdded), "", @"Examples.ActorsAndComponents.Content\NoComponents.xml");

        }

        protected override void OnDestroy()
        {
        }
    }
}
